package com.gui.base;


import java.util.ArrayList;
import java.util.List;

public class SyntaxSugarDemo1 {

    public static void main(String[] args) {
        variableArgs("Java", "Python", "PHP", "C++", ".NET");
    }

    private static void testSwitch(String key) {
        System.out.printf("key: %s, hashcode: %d%n", key, key.hashCode());
        switch (key) {
            case "3Qj":
                System.out.println("3Qj");
                break;
            case "2pj":
                System.out.println("2pj");;
                break;
            default:
                System.out.println("default");
        }
    }

    private static void testForEach(){
        List<String> list = new ArrayList<>();
        for (int i = 0; i < 5; i++) {
            list.add("I" + (i+2));
        }
        System.out.println(list);
    }

    private static void variableArgs(String ...params){
        for (String param : params) {
            System.out.println(param);
        }
    }
}
